package top.starp.util;

import java.util.List;

public class StringUtil {
   public  static   void printMarked(String string, List<Integer>markedIdxes){
        for (int i = 0; i <string.length() ; i++) {
            if(markedIdxes.contains(i)){
                System.out.print("("+string.charAt(i)+")");
            }else{
                System.out.print(string.charAt(i));
            }
        }
        System.out.println();
    }

    public  static   void printMarked(String string, List<Integer>markedIdxes,char markStart,char markEnd){
        for (int i = 0; i <string.length() ; i++) {
            if(markedIdxes.contains(i)){
                System.out.print(""+markStart+string.charAt(i)+markEnd);
            }else{
                System.out.print(string.charAt(i));
            }
        }
        System.out.println();
    }

    public  static   String removeBlank(String string){
       StringBuilder out= new StringBuilder();
        for (int i = 0; i <string.length() ; i++) {
//            Character.isB
//            TexUti
//            判断字符是空格类型 java
            if(string.charAt(i)==' '){
                continue;
            }
            out.append(string.charAt(i));

        }
        return out.toString();
    }

}
